Presentation: Tweet"Improving Correctness with Types"
Object oriented programmers create and use types everyday, however these are usually limited to classes that group and encapsulate data. A type system is capable of much more, when used to express invariants, the type system can prove these hold and show where they do not. Tests prove your code is correct for some values, types can prove your code is correct for all values.
Using Scala, this talk is aimed at developers with a background in object oriented programming who want to learn new ways to use types to improve the correctness of their code. It introduces the topic in a practical fashion, concentrating on the “easy wins” developers can apply to their code today.
We will look at how invariants and preconditions are traditionally expressed with assertions and the runtime errors they produce. Then show how common invariants can be expressed with custom data types and how these use compile-time errors to prevent bugs. This will touch on tagged types, typesafe wrappers, algebraic data types and path dependent types.
Finally the talk demonstrates there is a whole world of types outside of object oriented design and hopes to encourage you to spend the time to discover these for yourself.